-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust data loader example #1452
rust data loader example #1452
Conversation
@@ -0,0 +1,163 @@ | |||
#!/usr/bin/env rust-script | |||
//! Since Framework uses rust-script, we can define dependencies here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is really cool
// Displays both large and small percentages by adding decimal places | ||
// until there is something besides zeroes, or until the limit is hit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! Another “trick” I like with percentages is to not round 0.99999 to 100% but display it as 99.9%
(not applicable here, but I can see this function being reused in other contexts).
Just a few nitpicking comments :) It's a great example! |
As well as the review feedback, I made a fairly mechanical conversion of the Rust data loader into TypeScript, to get a speed comparison. Unsurprisingly, the Rust example is much faster, about 65x faster on my system. 20x of that can be theoretically attributed to parallelism, leaving a ~3x language speed up. I'm not sure if this should be included in the example though. What do you all think? |
I like the idea! |
For our recent data loaders, I had prepared two examples, but only had time to demo one of them in the presentation. This is the other one, a data loader example that uses Rust to simulate 10 million poker hands and reports the probability of getting each hand.